const formatDateYMDHM = (date) => `${date.getFullYear()}-${(date.getMonth() + 1)<10?'0'+(date.getMonth() + 1):date.getMonth() + 1}-${(date.getDate())<10?'0'+(date.getDate()):date.getDate()} ${(date.getHours())<10?'0'+(date.getHours()):date.getHours()}:${(date.getMinutes())<10?'0'+(date.getMinutes()):date.getMinutes()}`;
/** 
 * file转base64
*/
const blobToDataURL = (blob, cb) => {
    let reader = new FileReader();
    reader.onload = function (evt) {
        let base64 = evt.target.result;
        cb(base64);
    };
    reader.readAsDataURL(blob);
};
const hasNull = (params) => {
	var keys = Object.keys(params);
	for (var i = 0; i < keys.length; i++) {
		var obj = params[keys[i]];
		// console.log(keys[i],obj,obj == "")
		if (obj == null || obj === "" || obj == undefined) {
			return true;
		}
	}
	return false;
}

export default{
    formatDateYMDHM,
    blobToDataURL,
    hasNull
}